package com.danny.controller;

import com.danny.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisController {
	@Autowired
	RedisUtil redisUtil;

	@GetMapping("/redis")
	public String redis(){
		//设置key="first"，value="Hello World"
		redisUtil.set("first","Hello World");
		//取出key="first"的value值
		return (String)redisUtil.get("first");
	}
}
